package cn.xu.study.springdata.hibernatedemo;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public final class JPAUtil {
    private static EntityManagerFactory managerFactory;
    static {
        managerFactory = Persistence.createEntityManagerFactory("myJpa");
    }

    public static EntityManager getEntityManager(){
        return managerFactory.createEntityManager();
    }
}
